<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>9.3.5</title>
    <style type="text/css">
        #head {
            text-align: center;
        }

        #biao2 {
            width: 800px;
            height: 200px;
        }

        #center3 {
            margin-left: 20px;
        }

        #right {
            float: right;
        }
    </style>


    <script type="text/javascript">

        function changejieguo() {
            var shuru1 = parseFloat(document.getElementById("shuru1").value);
            var shuru2 = parseFloat(document.getElementById("shuru2").value);
            var shuchu = parseFloat(document.getElementById("shuchu").value);
            (shuchu == (shuru1 + shuru2)) ? alert("恭喜，你答对了！") :
                alert("很遗憾，你答错了，继续努力！");
        }
        function kaishi() {
            var shuru1 = parseInt(Math.random() * 100);
            var shuru2 = parseInt(Math.random() * 100);
            document.getElementById("shuru1").value = shuru1;
            document.getElementById("shuru2").value = shuru2;
        }
    </script>
</head>

<body>
    <p id="head">加法练习</p>
    <table id="biao2" border="1" align="center" cellspacing="0">

        </tr>
        <tr>
            <td>
                <div style="margin-top: 0px;margin-left: 20px;">

                    目标：100以内的加法
                </div>
                <br>
                <table style="margin-left: 20px;margin-top: 10px;" border="1" width="700px" height="100px"
                    cellspacing="0">
                    <tr>
                        <td>
                            <div align="center">
                                <input type="text" id="shuru1" readonly>
                                <font id="center3">+</font>
                                <input type="text" id="shuru2" readonly>
                                <font id="center3">=</font>
                                <input type="text" id="shuchu">
                                <input type="button" value="判题" onclick="changejieguo()">
                            </div>
                        </td>
                    </tr>

                </table>
                <div style="margin-left: 20px;margin-top: 10px;">
                    <br>
                    <input type="button" value="开始" onclick="kaishi()">
                </div> <br>
            </td>
        </tr>
    </table>
</body>

</html>